package com.DoubleLinkedList;

public class DoubleLinkedListDemo {
    public static void main(String[] args) {
// 测试
        System.out.println("双向链表的测试");
        // 先创建节点
        DHeroNode hero1 = new DHeroNode(1, "宋江", "及时雨");
        DHeroNode hero2 = new DHeroNode(2, "卢俊义", "玉麒麟");
        DHeroNode hero3 = new DHeroNode(3, "吴用", "智多星");
        DHeroNode hero4 = new DHeroNode(4, "林冲", "豹子头");
        // 创建一个双向链表
        DoubleLinkedList doubleLinkedList = new DoubleLinkedList();
        doubleLinkedList.addNodeByOrder(hero1);
        doubleLinkedList.addNodeByOrder(hero2);
        doubleLinkedList.addNodeByOrder(hero4);
        doubleLinkedList.addNodeByOrder(hero3);
        doubleLinkedList.showLinkedList();
//        doubleLinkedList.updateNode(new DHeroNode(4, "公孙胜", "入云龙"));
        System.out.println("==========");
        doubleLinkedList.showLinkedList();
        doubleLinkedList.deleteByNo(3);
        System.out.println("==========");
        doubleLinkedList.showLinkedList();
    }
}
